package pandabay.web;

import org.springframework.web.servlet.mvc.SimpleFormController;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.ServletException;

import pandabay.domain.User;

public class LoginFormController extends SimpleFormController {

    @Override
    protected ModelAndView onSubmit(Object command) throws ServletException {
	    User user = (User) command;
	    String name = user.getEmail();
	    
	    ModelAndView modelAndView = new ModelAndView(getSuccessView());
	    modelAndView.addObject("name", name);  
	    return modelAndView;
    }

}